﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace Hydra.Contract
{
    [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IHydraCallback))]
    public interface IHydraService
    {
        [OperationContract(IsInitiating = true, IsTerminating = false)]
        void WriteLog(LogLevel level, string message);

        [OperationContract(IsInitiating = true, IsTerminating = false)]
        void RegisterListener();

        [OperationContract(IsInitiating = false, IsTerminating = false)]
        void UnregisterListener();
    }

    [ServiceContract]
    public interface IHydraCallback
    {
        [OperationContract(IsOneWay = true)]
        void WriteLog(string message);

        [OperationContract(IsOneWay = true)]
        void RunTask(string parameter);

        //[OperationContract(IsOneWay = true)]
        //void RunTaskX(ITask task);
    }

    [ServiceContract]
    public interface ITask
    {
        void Execute();
    }
}
